package tgc.edu.tms.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import tgc.edu.tms.custom.CommonRepository;
import tgc.edu.tms.entity.ClassSchedule;
import tgc.edu.tms.entity.Jcb;
import tgc.edu.tms.entity.SysUser;

@Repository
public interface ClassScheduleRepository extends CommonRepository<ClassSchedule, Integer> {

	public List<ClassSchedule> findByEpTeacherUsername(String username);

	public List<ClassSchedule> findByJcbJcsjAndJcbXqAndEpTeacherUsername(String jc, String weekDay, String teacher);

	public List<ClassSchedule> findByJcbJcsjAndJcbXqAndClassroomSerialNumber(String section, String weekDay,
			String address);

	public List<ClassSchedule> findByJcbJcsjAndJcbXqAndEpCurriculumKcmc(String section, String weekDay2,
			String curriculum);

	public List<ClassSchedule> findByJcbJcsjAndJcbXq(String jc, String weekDay2);

	public List<ClassSchedule> findByEpTeacherUsernameAndJcbJcsjAndJcbXq(String username, String section, String week);
	
	public ClassSchedule findByJcbAndClassroomSerialNumber(Jcb jcb, String classroom);

	public ClassSchedule findByJcbAndEpTeacherUsername(Jcb jcb, String teacher);

	public List<ClassSchedule> findByJcb(Jcb jcb);

	public List<ClassSchedule> findByJcbXqAndClassroomLocationNameAndClassroomFloor(String week, String name,
			String floor);


	@Query(value="select max(id) from class_schedule",nativeQuery=true)
	public Integer findMaxId();

	public List<ClassSchedule> findByEpSchoolyearId(Integer schoolyearID);

	public List<ClassSchedule> findByEpTeacherIdAndEpSchoolyearId(Integer id, Integer schoolyearID);

	public void deleteByEpSchoolyearId(Integer schoolyearID);

	//public List<ClassSchedule> findByTbclassLiveAndEpSchoolyear(String className,String schoolYear);


	
	
}
